In a wireless local area network (WLAN), a station (STA) finds a wireless access point (AP) by using an Active Scanning mode or a Passive Scanning mode. In the active scanning mode, the STA sends a probe request frame to detect a wireless AP existent nearby. In the case of passive scanning, the STA listens to a beacon frame sent by a wireless AP to obtain information about a surrounding network. A process of detecting a wireless AP by a STA in an active scanning mode is shown in FIG. 1, and includes the following steps.
S101. The STA sends a probe request frame. The STA may broadcast or unicast the probe request frame. If the STA broadcasts the probe request frame, a receiver address (RA) in the probe request frame is a broadcast address, a basic service set identifier (BSSID) in the probe request frame is a wildcard BSSID, and a service set identifier (SSID) in the probe request frame is a wildcard SSID.
S102. An AP1, an AP2, and an AP3 that receive the probe request frame sent by the STA respond with corresponding probe response frames.
After receiving the probe response frames sent by the AP1, the AP2, and the AP3, the STA selects the AP1. The STA may select a wireless AP according to signal strength.
S103. Optionally, if authentication is required, authentication may be performed on the STA. If the authentication succeeds, the following process continues.
S104. The STA associates with the AP1.
In this way, the STA may start to transmit a data frame to the AP1. After associating with the AP1, the STA may further perform active scanning, that is, broadcasting a probe request frame, to collect information about a surrounding network. For example, when the STA needs to roam, the STA broadcasts a probe request frame, and the AP2 and the AP3 that receive the probe request frame respond with probe response frames. The probe response frame is a management frame and is generally sent at a minimum rate to ensure its reliability. Therefore, the probe response frame occupies a wireless medium for a long time.
When there are a large quantity of wireless APs in the WLAN, all wireless APs respond to a received probe request frame. Consequently, a large quantity of wireless medium resources is occupied.